package com.ai.mall.controller.front;

import com.ai.mall.service.AddressesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/address")
public class AddressController {

    @Autowired
    private AddressesService addressService;

    /**
     * 获取用户地址列表接口
     * @param userId 用户ID
     * @return 地址列表
     */
    @GetMapping("/list/{userId}")
    public String getAddressList(@PathVariable int userId) {
        // 调用AddressService获取地址列表
//        return addressService.getAddressList(userId);
        return null;
    }

    /**
     * 添加新地址接口
     * @param userId 用户ID
     * @param address 地址信息
     * @return 添加结果
     */
    @PostMapping("/add")
    public String addAddress(@RequestParam int userId, @RequestParam String address) {
        // 调用AddressService添加新地址
//        return addressService.addAddress(userId, address);
        return null;
    }

    /**
     * 更新地址接口
     * @param addressId 地址ID
     * @param address 新地址信息
     * @return 更新结果
     */
    @PutMapping("/update/{addressId}")
    public String updateAddress(@PathVariable int addressId, @RequestParam String address) {
        // 调用AddressService更新地址
//        return addressService.updateAddress(addressId, address);
        return null;
    }

    /**
     * 删除地址接口
     * @param addressId 地址ID
     * @return 删除结果
     */
    @DeleteMapping("/delete/{addressId}")
    public String deleteAddress(@PathVariable int addressId) {
        // 调用AddressService删除地址
//        return addressService.deleteAddress(addressId);
        return null;
    }
}